package com.z6school.manage.controller;

import com.z6school.manage.common.pojo.JsonResult;
import com.z6school.manage.po.Curriculum;
import com.z6school.manage.service.CurriculumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/curriculum/")
public class CurriculumController {

    @Autowired
    private CurriculumService curriculumService;

    @RequestMapping("doFindAllMessage")
    public JsonResult doFindAllMessage(String username, Integer pageCurrent){
        return new JsonResult(curriculumService.doFindAllMessage(username, pageCurrent));
    }

    @RequestMapping("doDeleteObjects")
    public JsonResult doDeleteObjects(String ids){
        curriculumService.doDeleteObjects(ids);
        return new JsonResult("delete ok");
    }

    @RequestMapping("addCurriculumMessage")
    public JsonResult addCurriculumMessage(Curriculum curriculum){
        curriculumService.addCurriculumMessage(curriculum);
        return new JsonResult("insert ok");
    }

}
